<#--布局-->
<#assign ctx="${rc.contextPath}">
<#macro layout title="" attributes="">
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>${title}</title>
        <link rel="stylesheet" type="text/css" media="all" href="${ctx}/style/style_default.css" title="default">
        <link rel="stylesheet" type="text/css" media="all" href="${ctx}/style/zTreeStyle.css" title="default">
        <link rel="stylesheet" type="text/css" media="all" href="${ctx}/style/ui/jquery-ui-1.8.20.custom.css" title="default">
        <script type="text/javascript" src="${ctx}/scripts/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="${ctx}/scripts/jquery-ui-1.8.17.custom.min.js"></script>
        <script type="text/javascript" src="${ctx}/scripts/jquery.ui.datepicker-zh-CN.js"></script>
        <script type="text/javascript" src="${ctx}/scripts/jquery.ztree.core-3.0.min.js"></script>
        <script type="text/javascript">
            var sisClosePic = true;
            var _context = '${rc.contextPath}';
            var soverPic = _context + "/images/serach_zz.gif";
            var soutPic = _context + "/images/serach_zz.gif";
            function schangePicture(action,obj,pic) {
                var currentPic = obj.src;
                if(action == "click") {
                    if(sisClosePic) {
                        sisClosePic = false;
                        soverPic = _context + '/images/serach_zz2.gif';
                        soutPic = _context + '/images/serach_zz2.gif';
                        obj.src = _context + "/images/serach_zz2.gif";//Open
                    } else {
                        sisClosePic = true;
                        soverPic = _context + '/images/serach_zz.gif';
                        soutPic = _context + '/images/serach_zz.gif';
                        obj.src = _context + "/images/serach_zz.gif";//Close
                    }
                    return;
                }
                if(action == "over") {
                    obj.src = soverPic;
                    return;
                }
                if(action == "out") {
                    obj.src = soutPic;
                }
            }

            function switchSTD(id){
                var _ele = jQuery("#" + (id || "searcharea"));
                if (_ele.css('display') == "none"){
                    _ele.show();
                }else {
                    _ele.hide();
                }
            }
        </script>
    </head>
    <body <#if attributes!="">${attributes}</#if>>
    <#nested 1 />
    </body>
    </html>
</#macro>

<#macro main title="" attributes="">
	<html>
		<head>
			<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
			<title>${title}</title>
		</head>
	
		<frameset rows="91,*" framespacing="0" border="0" frameborder="0">
			<frame name="banner" scrolling="no" noresize target="contents"
				src="${ctx}/heading.htm" frameborder="0" framespacing="0" border="0"
				marginwidth="0" marginheight="0">
			<frameset cols="180,*">
				<frame name="contents" target="main" scrolling="no"
					src="${ctx}/tree.htm" frameborder="0" framespacing="0" border="0"
					marginwidth="1" marginheight="1" noresize>
				<frame name="main" src="${ctx}/${attributes}" frameborder="0"
					framespacing="0" border="0" marginwidth="0" marginheight="0"
					scrolling="auto">
			</frameset>
			<noframes>
				<body>
	
					<p>
						此网页使用了框架，但您的浏览器不支持框架。
					</p>
	
				</body>
			</noframes>
		</frameset>
	</html>
</#macro>


<#--分页器-->
<#macro p paginator action="">
    <form action="${action}" method="post" id="_form_">
        <#if paginator.getPage() == 1>
            <span style="color: #000;">首页&nbsp;上页&nbsp;</span>
        <#else>
            <a href="javascript:pickpage(1);">首页</a>&nbsp;
            <a href="javascript:pickpage(${paginator.getPreviousPage()});">上页</a>&nbsp;
        </#if>

        <#if paginator.getPage() == paginator.getLastPage()>
            <span style="color: #000;">下页&nbsp;尾页&nbsp;</span>
        <#else>
            <a href="javascript:pickpage(${paginator.getNextPage()});">下页</a>&nbsp;
            <a href="javascript:pickpage(${paginator.getLastPage()});">尾页</a>&nbsp;
        </#if>

        第${paginator.getBeginIndex()}条到${paginator.getEndIndex()}条/共${paginator.getItems()}条&nbsp;
        第${paginator.getPage()}页/共${paginator.getPages()}页&nbsp;
        <label for="_jump_page_">跳转到</label>
        <input id="_jump_page_" name="textfield" type="text" value="${paginator.getPage()}" class="input_textfield_page"/>
        页&nbsp;
        <label for="_jump_page_size_">每页显示</label>
        <input id="_jump_page_size_" name="textfield" type="text" value="${paginator.getItemsPerPage()}" class="input_textfield_page"/>
        条
        <input type="button" class="List_go" value="" onclick="_go()" />
        <input type="hidden" id="_hidden_page_" value="${paginator.getPage()}" />
        <input type="hidden" id="_hidden_start_" name="rowBounds.start" value="0">
        <input type="hidden" id="_hidden_page_size_" name="rowBounds.pageSize" value="${paginator.getItemsPerPage()}">
        <#--这里可以填写自定义元素-->
        <#nested 1 />
    </form>
    <script type="text/javascript">
        //防冲突，添加下划线
        var _byId = function (id) {
            return document.getElementById(id);
        };

        function pickpage(page) {
            var pageSize = _byId("_hidden_page_size_").value;
            _byId("_hidden_start_").value = (page - 1) * parseInt(pageSize) + 1;
            _byId("_form_").submit();
        }

        function _go() {
            var current =  _byId("_hidden_page_").value;
            current = parseInt(current);

            var userPage = _byId("_jump_page_").value;

            current = userPage && parseInt(userPage) || current;

            var _pageSize = _byId("_hidden_page_size_").value;
            _byId("_hidden_start_").value = (current - 1) * parseInt(_pageSize) + 1;

            _byId("_hidden_page_size_").value = _byId("_jump_page_size_").value ;
            _byId("_form_").submit();
        }
    </script>

</#macro>

<#--分页器-->
<#macro pager page action="">
    <form action="${action}" method="post" id="_form_">
    	共${page.totalRow}条 / 第${page.getPageNumber()}页 / 共${page.getTotalPage()}页
        <#if page.getPageNumber() == 1>
            <span style="color: #000;">首页&nbsp;上页&nbsp;</span>
        <#else>
            <a href="javascript:pickpage(1);" style="color:#F08334;	text-decoration: none;">首页</a>&nbsp;
            <a href="javascript:pickpage(${page.getPageNumber() - 1});" style="color:#F08334;	text-decoration: none;">上页</a>&nbsp;
        </#if>

        <#if page.getPageNumber() == page.getTotalPage()>
            <span style="color: #000;">下页&nbsp;尾页&nbsp;</span>
        <#else>
            <a href="javascript:pickpage(${page.getPageNumber() + 1});" style="color:#F08334;	text-decoration: none;">下页</a>&nbsp;
            <a href="javascript:pickpage(${page.getTotalPage()});" style="color:#F08334;	text-decoration: none;">尾页</a>&nbsp;
        </#if>

        <input type="hidden" id="_hidden_pageNo_" name="pageNo" value="0">
        <input type="hidden" id="_hidden_page_size_" name="pageSize" value="20">
        <#--这里可以填写自定义元素-->
        <#nested 1 />
    </form>
    <script type="text/javascript">
        //防冲突，添加下划线
        var _byId = function (id) {
            return document.getElementById(id);
        };

        function pickpage(page) {
            var pageSize = _byId("_hidden_page_size_").value;
            _byId("_hidden_pageNo_").value = page;
            _byId("_form_").submit();
        }
    </script>

</#macro>

<#macro selected v1 v2>
    <#if v1 == v2>
        selected='selected'
    </#if>
</#macro>
